import 'package:flutter_menu/data/base_provider.dart';
import 'package:flutter_menu/model/material_model.dart';
import 'package:flutter_menu/objectbox.g.dart';

class MaterialProvider extends BaseProvider<MaterialModel> {
  MaterialProvider(super.store);

  Future<MaterialModel?> getMaterialModelWithIdAsync(String id) {
    return box
        .query(MaterialModel_.materialId.equals(id))
        .build()
        .findFirstAsync();
  }

  MaterialModel? getMaterialModelWithId(String id) {
    return box.query(MaterialModel_.materialId.equals(id)).build().findFirst();
  }
}

class ItemId {
  final String? specId;
  final String? optionId;

  ItemId({this.specId, this.optionId});
}
